import java.util.Properties;


public class CustomerLogoutActivity extends Activity {

	public CustomerLogoutActivity(Properties props) {
		super(props);
	}

	public ActivityResult execute(Resource db, Resource noss) {
		
		CorporateDatabase database = null;
		ActivityResult result= new ActivityResult();
		
		if(!(db instanceof CorporateDatabase)) {
			result.setResult(-1);
		}
		else {
			database = (CorporateDatabase)db;
			String query = "";
			
			query += "DELETE FROM account_locks " +
					 "WHERE account_number=" + (String) parameters.getProperty(Constants.ACCOUNT_NUMBER) + ";";
			
			database.execute(query);
			
			result.setResult(1);
		}
		return result;
	}

	 
	public String getType() {
		return Constants.DATABASE;
	}
}
